package com.ljye.jg.ljye.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.ljye.jg.ljye.R;
import com.ljye.jg.ljye.activity.Activity_Balance;
import com.ljye.jg.ljye.activity.Activity_Evaluate;
import com.ljye.jg.ljye.activity.Activity_My_Order;
import com.ljye.jg.ljye.activity.Activity_Punch_Sign;
import com.ljye.jg.ljye.activity.Activity_Setting;
import com.ljye.jg.ljye.activity.Activity_integral;

import de.hdodenhof.circleimageview.CircleImageView;


/**
 * Created by Administrator on 2016/9/29.
 */
public class Fragment_me extends Fragment {
    private Intent intent;

    public View.OnClickListener listener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            switch (view.getId()) {
                case R.id.bianji://编辑
                    break;
                case R.id.order://订单
                    intent = new Intent(getActivity(), Activity_My_Order.class);
                    startActivity(intent);
                    break;
                case R.id.evaluate://评价
                    intent = new Intent(getActivity(), Activity_Evaluate.class);
                    startActivity(intent);
                    break;
                case R.id.sign://签到
                    intent = new Intent(getActivity(), Activity_Punch_Sign.class);
                    startActivity(intent);
                    break;
                case R.id.integral://积分
                    intent = new Intent(getActivity(), Activity_integral.class);
                    startActivity(intent);
                    break;
                case R.id.activity://活动
                    break;
                case R.id.balance://余额
                    intent = new Intent(getActivity(), Activity_Balance.class);
                    startActivity(intent);
                    break;
                case R.id.set://设置
                    intent = new Intent(getActivity(), Activity_Setting.class);
                    startActivity(intent);
                    break;
                default:
                    break;
            }
        }
    };
    private View view;
    private TextView bianji;//编辑资料
    private CircleImageView head;//头像
    private TextView name;//名字
    private TextView address;//地址
    private LinearLayout order;//订单
    private TextView dot1;//订单小红点1
    private LinearLayout evaluate;//评价
    private TextView dot2;//评价小红点
    private LinearLayout sign;//签到
    private TextView dot3;//签到小红点
    private LinearLayout integral;//积分
    private TextView dot4;//积分小红点
    private TextView integralNumber;//积分数字
    private LinearLayout activity;//活动
    private TextView dot5;//活动小红点
    private LinearLayout balance;//余额
    private TextView dot6;//余额小红点
    private TextView balanceNumber;//余额数字
    private LinearLayout set;//设置
    private TextView dot7;//设置小红点

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (null == view) {
            view = inflater.inflate(R.layout.fragment_me, null);
            initView();

            bianji.setOnClickListener(listener);
            order.setOnClickListener(listener);
            evaluate.setOnClickListener(listener);
            sign.setOnClickListener(listener);
            integral.setOnClickListener(listener);
            activity.setOnClickListener(listener);
            balance.setOnClickListener(listener);
            set.setOnClickListener(listener);
        }
        return view;

    }

    private void initView() {
        bianji = (TextView) view.findViewById(R.id.bianji);
        head = (CircleImageView) view.findViewById(R.id.head);
        name = (TextView) view.findViewById(R.id.name);
        address = (TextView) view.findViewById(R.id.address);
        order = (LinearLayout) view.findViewById(R.id.order);
        dot1 = (TextView) view.findViewById(R.id.dot1);
        evaluate = (LinearLayout) view.findViewById(R.id.evaluate);
        dot2 = (TextView) view.findViewById(R.id.dot2);
        sign = (LinearLayout) view.findViewById(R.id.sign);
        dot3 = (TextView) view.findViewById(R.id.dot3);
        integral = (LinearLayout) view.findViewById(R.id.integral);
        dot4 = (TextView) view.findViewById(R.id.dot4);
        integralNumber = (TextView) view.findViewById(R.id.integral_number);
        activity = (LinearLayout) view.findViewById(R.id.activity);
        dot5 = (TextView) view.findViewById(R.id.dot5);
        balance = (LinearLayout) view.findViewById(R.id.balance);
        dot6 = (TextView) view.findViewById(R.id.dot6);
        balanceNumber = (TextView) view.findViewById(R.id.balance_number);
        set = (LinearLayout) view.findViewById(R.id.set);
        dot7 = (TextView) view.findViewById(R.id.dot7);


    }


}
